import { request } from '@/utils/request';

/**
 * @description 查询机构指定的人员数据
 */
export function listPersonnelApi(data?: any) {
  return request(
    {
      url: '/interface/personnel/listPersonnel',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    },
  );
}

/**
 * 查询人员分页数据
 * @description 查询机构指定的人员数据
 */
export function listPersonnelPageApi(data?: any) {
  return request(
    {
      url: '/cms/personnel/listCmsPersonnelPage',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    },
  );
}

/**
 * 添加人员数据
 * @description 查询机构指定的人员数据
 */
export function addCmsPersonnelApi(data?: any) {
  return request(
    {
      url: '/cms/personnel/addCmsPersonnel',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    },
  );
}

/**
 * 查询人员绑定数据
 * @description 查询机构指定的人员数据
 */
export function findPersonnelBedApi(data?: any) {
  return request(
    {
      url: '/cms/personnel/bed/find',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    },
  );
}

/**
 * 添加人员设备数据
 * @description 查询机构指定的人员数据
 */
export function batchAddApi(data?: any) {
  return request(
    {
      url: '/cms/personnel/device/batchAdd',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    },
  );
}

/**
 * 查询人员设备数据
 * @description 查询机构指定的人员数据
 */
export function findListApi(data?: any) {
  return request(
    {
      url: '/cms/personnel/device/findList',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    },
  );
}

/**
 * 修改人员数据
 * @description 查询机构指定的人员数据
 */
export function modifyCmsPersonnelApi(data?: any) {
  return request(
    {
      url: '/cms/personnel/modifyCmsPersonnel',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    },
  );
}

/**
 * 查询指定人员数据
 * @description 查询机构指定的人员数据
 */
export function findByIdApi(data?: any) {
  return request(
    {
      url: '/cms/personnel/findById',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    },
  );
}

/**
 * @description 获取报警文字
 */
export function buildMessageApi(data?: any) {
  return request(
    {
      url: '/interfaces/tpush/buildMessage',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    },
  );
}

/**
 * @description 请求语音合成
 */
export function loadVoiceApi(params?: any) {
  return request(
    {
      url: '/configure/voice/loadVoice',
      method: 'get',
      params,
    },
    {
      isDataDirectly: false,
    },
  );
}

/**
 * @description 设备异常处理
 */
export function earlyHandleApi(data?: any) {
  return request(
    {
      url: '/lms/device/early/earlyHandle',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    },
  );
}

/**
 * @description 床垫异常处理
 */
export function mattressEarlyHandleApi(data?: any) {
  return request(
    {
      url: '/lms/device/early/mattressEarlyHandle',
      method: 'post',
      data,
    },
    {
      isDataDirectly: false,
    },
  );
}

/**
 * @description 历史数据
 */
export function listNursingRecordPageApi(data?: any) {
  return request(
    {
      url: '/pms/record/nursing/findNursingRecordPageList',
      method: 'post',
      data,
    },
    {
      isDataDirectly: true,
    },
  );
}
